using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.ExpressApp.DC;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Xpo;
using DevExpress.Persistent.Validation;
namespace Ascent.QiPei.Module.BusinessObjects.Inventory
{
  [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("库存盘点")]
  public partial class InventoryVerificationItems : DevExpress.Persistent.BaseImpl.BaseObject
  {
    private System.String _remark;
    private System.String _diffReason;
    private System.Int32 _diffQty;
    private System.Int32 _realQty;
    private System.Int32 _inventoryQty;
    private Ascent.QiPei.Module.BusinessObjects.Base.Product _product;
    private Ascent.QiPei.Module.BusinessObjects.Inventory.InventoryVerification _inventoryVerification;
    public InventoryVerificationItems(DevExpress.Xpo.Session session)
      : base(session)
    {
    }
    [DevExpress.Xpo.AssociationAttribute("InventoryVerificationItemses-InventoryVerification")]
    public Ascent.QiPei.Module.BusinessObjects.Inventory.InventoryVerification InventoryVerification
    {
      get
      {
        return _inventoryVerification;
      }
      set
      {
        SetPropertyValue("InventoryVerification", ref _inventoryVerification, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("产品")]
    [RuleRequiredField(DefaultContexts.Save)]
    public Ascent.QiPei.Module.BusinessObjects.Base.Product Product
    {
      get
      {
        return _product;
      }
      set
      {
          SetPropertyValue("Product", ref _product, value);
        //if (_product == value)
        //  return;
        //Ascent.QiPei.Module.BusinessObjects.Base.Product prevProduct = _product;
        //_product = value;
        //if (IsLoading)
        //  return;
        //if (prevProduct != null && prevProduct.InventoryVerificationItems == this)
        //  prevProduct.InventoryVerificationItems = null;
        //if (_product != null)
        //  _product.InventoryVerificationItems = this;
        //OnChanged("Product");
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("库存数量")]
    [RuleRequiredField(DefaultContexts.Save)]
    public System.Int32 InventoryQty
    {
      get
      {
        return _inventoryQty;
      }
      set
      {
        SetPropertyValue("InventoryQty", ref _inventoryQty, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("实盘数量")]
    [RuleRequiredField(DefaultContexts.Save)]
    public System.Int32 RealQty
    {
      get
      {
        return _realQty;
      }
      set
      {
        SetPropertyValue("RealQty", ref _realQty, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("差异数量")]
    public System.Int32 DiffQty
    {
      get
      {
        return _diffQty;
      }
      set
      {
        SetPropertyValue("DiffQty", ref _diffQty, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("差异原因")]
    public System.String DiffReason
    {
      get
      {
        return _diffReason;
      }
      set
      {
        SetPropertyValue("DiffReason", ref _diffReason, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("备注")]
    public System.String Remark
    {
      get
      {
        return _remark;
      }
      set
      {
        SetPropertyValue("Remark", ref _remark, value);
      }
    }
  }
}
